import {API} from './index'

export const getUserInfoApi = (userAccount, userPassword) => {
    return API('/user/login', {userAccount, userPassword}, 'POST', '')
}

export const getUserById = (id: string | number) => {
    return API('/user/get/' + id, {}, 'GET', '')
}

export const registerApi = (userAccount, checkPassword, userPassword, userName, positionId) => {
    return API('/user/register', {userAccount, checkPassword, userPassword, userName, positionId}, 'POST', '')
}

export const deleteUserApi = (id, isRole) => {
    return API('/user/delete/' + id + '/' + isRole, {}, 'DELETE', '')
}

export const getLeaderUserApi = (id) => {
    return API('/user/get/' + id, {}, 'GET', '')
}

export const userUpdateApi = (userAccount, userEmail, userId, userName, userPassword, userPhone) => {
    return API('/user/userUpdate', {userAccount, userEmail, userId, userName, userPassword, userPhone}, 'PUT', '')
}